package com.testDemo.jdk8.time;

import com.testDemo.jdk8.stream.Student;
import org.junit.jupiter.api.Test;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author: zour
 * @date: 2024/5/29
 * @description:
 */
public class LocalDateTimeTest {
    @Test
    public void now() {
        LocalDateTime now = LocalDateTime.now();
        int hour = now.getHour();
        int minute = now.getMinute();
        int second = now.getSecond();

        System.out.println("时: " + hour);
        System.out.println("分: " + minute);
        System.out.println("秒: " + second);

        System.out.println(String.format("%s:%s:%s",hour,minute,second));
    }
    @Test
    public  void aa(){
//        System.setProperty("user.timezone", "Asia/Shanghai");
        System.out.println(System.getProperty("user.timezone"));
        System.out.println(TimeZone.getDefault());

//        TimeZone.setDefault(TimeZone.getTimeZone(ZoneId.SHORT_IDS.get("CTT")));
        System.out.println();
    }
}
